package trunk;

public enum Mode {
	
    IM("#"), DIR(" "), INDIR("@"), DEC("<");
    
    private String s;
    
    Mode(String s) {this.s = s;}
    
    static Mode toMode(String s) throws ModeException {
    	if (s==null) {return DIR;}
    	if (s.equals("#")) {return IM;}
    	if (s.equals("@")) {return INDIR;}
    	if (s.equals("<")) {return DEC;}
    	throw new ModeException(s);
    }
    
    public String toString() {return s;}
    
}

